import { useHistory } from 'react-router-dom'

const useGoToPersonal = () => {
    const history = useHistory()
    
    const handleInfoClick = name => {
        return () => {
            history.push('/name', { name })
        }
    }
    
    const handleImgClick = img => {
        return () => {
            history.push('/portrait', { img })
        }
    }
    
    const handleEmerClick = () => {
        return () => {
            history.push('/emergency')
        }
    }
    
    const handleAccountClick = () => {
        return () => {
            history.push('/account')
        }
    }
    const handleQRcodeClick = img => {
        return () => {
            history.push('/qrcode', { img })
        }
    }

    


    return {
        handleInfoClick,
        handleImgClick,
        handleEmerClick,
        handleAccountClick,
        handleQRcodeClick,
    }
}

export default useGoToPersonal